package com.ecb.business.remote.client;

import com.alibaba.fastjson.JSON;
import com.dtflys.forest.annotation.*;
import com.ecb.business.dto.api.RemoteResult;
import com.ecb.business.dto.chain.HealthCheckDTO;


/**
 * @author:wtlu
 * @Despriction:
 * @Date: Created in 2024/10/5 15:39
 * @Modify By: wtlu
 */

public interface HealthCheckRemote {


//    @Get(url = "http://${baseUrl}/apps/${appId}/navtree")
//    String navtree(@Var("baseUrl") String baseUrl, @Var("appId") String appId, OnLoadCookie onLoadCookie);


    @Post(url = "http://${baseUrl}/hunter-client-blockchain/openApi/healthCheck")
    String healthCheck(@Var("baseUrl") String baseUrl, @JSONBody HealthCheckDTO data);

    default RemoteResult parse(String result) {
        final RemoteResult dbaResult = JSON.parseObject(result, RemoteResult.class);
        dbaResult.setOriginTxt(result);
        return dbaResult;
    }
}
